package cn.broadmax.boot.exception;

import jexx.util.StringUtil;

/**
 * web中通过验证异常
 *
 * @author jeff
 * @date 2019/6/25
 */
public class WebException extends RuntimeException {

    /**
     * 是否支持对message的国际化, 默认false
     */
    private boolean supportI18n;

    /**
     * 错误信息
     */
    private String error;

    public WebException() {
    }

    public WebException(String message, Object... args) {
        super(StringUtil.format(message, args));
    }

    public WebException(Throwable cause, String message, Object... args) {
        super(StringUtil.format(message, args), cause);
    }

    public void setSupportI18n(boolean supportI18n) {
        this.supportI18n = supportI18n;
    }

    public boolean isSupportI18n() {
        return supportI18n;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}
